<?php

namespace app\model;

use think\Model;

class UuidRelation extends Model
{

	protected $connection = 'mysql';

	protected $pk = 'id';

	protected $name = 'uuid_relation';

	public static function getuuid($uid)
	{
		$query = self::where(['weid' => weid(), 'uid' => $uid]);
		$mob = $query->order('id desc')->find();

		if (!empty($mob)) {
			return $mob->uuid;
		}
	}

	public static function getuid($uuid)
	{
		$query = self::where(['weid' => weid(), 'uuid' => $uuid]);
		$mob = $query->order('id desc')->find();

		if (!empty($mob)) {
			return $mob->uid;
		}
	}
}
